home *** CD-ROM | disk | FTP | other *** search
/ Birds of My State or Province 4.5 / eField Guide Viewer.iso / pc / Windows / CR115.cab / viewrpt.aspx.09012B1E_8731_4B9A_8C8B_6CA68543BF28 < prev    next >
Encoding:
Text File  |  2007-01-16  |  1.7 KB  |  70 lines

  1. <!--
  2.   File Version Start - Do not remove this if you are modifying the file
  3.   Build: 11.0.0
  4.   File Version End
  5.  
  6.     (c) 2004 Business Objects, Inc.  All rights reserved.
  7.     This code or any derivative work thereof may not be distributed without the express written
  8.     permission of Business Objects.
  9. -->
  10. <%@ Page EnableSessionState="True" Language="JScript" codepage="65001" aspCompat="True" %>
  11. <%
  12.  
  13.  
  14. function GetSession(name)
  15. {
  16.     return Session[name];
  17. }
  18.  
  19. function SetSession(name, value)
  20. {
  21.     Session[name] = value;
  22. }
  23.  
  24. function GetQueryOrForm(name)
  25. {
  26.     var value = Request.QueryString.Item[name];
  27.     if (value == undefined)
  28.         value = Request.Form.Item[name]
  29.     return value;
  30. }
  31.  
  32. function PreventCaching()
  33. {
  34.     // prevent browser from caching the page
  35.     var cache_date = new Date();
  36.     cache_date.setFullYear( cache_date.getFullYear() - 1 );
  37.     Response.ExpiresAbsolute = cache_date.getVarDate();
  38. }
  39.  
  40. PreventCaching();
  41.  
  42. try
  43. {  
  44.   var initStr : String;
  45.   var rptid =  GetQueryOrForm ("id");
  46.   initStr = GetQueryOrForm( "init" );
  47.   if (initStr == undefined)
  48.      initStr = GetQueryOrForm( "viewer" );
  49.  
  50.   var cmdStr = GetQueryOrForm("cmd");
  51.   if (cmdStr.toLowerCase() != "export" && (rptid != undefined && (initStr == undefined || (!initStr.toLowerCase().StartsWith("java") && !initStr.toLowerCase().StartsWith("actx")))))
  52.     Server.Transfer("./viewrpt_cache.aspx");
  53.  
  54.   var bridge;
  55.   bridge = GetSession("RptSrcBridge");
  56.   if (typeof(bridge) != "object")
  57.   {
  58.     bridge = Server.CreateObject( "CrystalReports.CRReportSourceBridge" );
  59.     SetSession("RptSrcBridge", bridge);
  60.   }
  61.      
  62.   bridge.ProcessHttpRequest( );   
  63. }
  64. catch(e)
  65. {
  66.   Response.Write( e.description );
  67. }
  68.  
  69. %>
  70.